﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using Itop.YHPC.Model;
using Itop.YHPC.controller;

namespace Itop.YHPC.workflow
{
    public partial class workflow_tree_ajax : AjaxPage<forTree>
    {
        protected override IList<forTree> onRead()
        {
            IList<forTree> treeList = new List<forTree>();
            /*forTree root = new forTree();
            root.id = "0";
            root.leaf = false;
            root.text = "ROOT";
            treeList.Add(root);*/
            //IList<sysprog> progList = workflowController.GetProgList(" where ParentID='1'");
            DataRow[] rows = BasePage.GetUserProgs(null).Select("ParentID='1'");
            foreach (DataRow  prog in rows)
            {
                forTree leaf = new forTree();
                leaf.id = prog["id"].ToString();
                leaf.text = prog["ProgName"].ToString();
                treeList.Add(leaf);
            }
            return treeList;
        }
    }
}
